package com.formation.tocea.library.client.ui.form;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.TextBox;

public class UpdateAccountForm extends Grid {
	private Label nameLabel;
	private Label surnameLabel;
	private Label loginLabel;
	private Label passwordLabel;
	private TextBox nameTextBox;
	private TextBox surnameTextBox;
	private TextBox loginTextBox;
	private PasswordTextBox passwordTextBox;
	private HorizontalPanel buttonPanel;
	private Button submitButton;
	
	public UpdateAccountForm() {
		init();
	}

	public void init() {
		setWidth("100");
		resize(5, 2);
		
		nameLabel = new Label("Prenom");
		surnameLabel = new Label("Nom");
		loginLabel = new Label("Login");
		passwordLabel = new Label("Mot de passe");
		
		nameTextBox = new TextBox();
		surnameTextBox = new TextBox();
		loginTextBox = new TextBox();
		passwordTextBox = new PasswordTextBox();
		submitButton = new Button("Sauvegarder");
		
		buttonPanel = new HorizontalPanel();
		buttonPanel.setSpacing(3);
		buttonPanel.add(submitButton);
		
		//submitButton.addClickHandler(new LoginSubmitListener(this));
		//closeButton.addClickHandler(new HideLoginFormListener(this));
		
		setWidget(0, 0, nameLabel);
		setWidget(0, 1, nameTextBox);
		setWidget(1, 0, surnameLabel);
		setWidget(1, 1, surnameTextBox);
		setWidget(2, 0, loginLabel);
		setWidget(2, 1, loginTextBox);
		setWidget(3, 0, passwordLabel);
		setWidget(3, 1, passwordTextBox);
		setWidget(4, 1, buttonPanel);
	}
}
